package jangdolbaeng2.db;

import jangdolbaeng2.vo.CartVO;
import jangdolbaeng2.vo.CustomerVO;
import jangdolbaeng2.vo.DeliveryVO;
import jangdolbaeng2.vo.Order_detailVO;
import jangdolbaeng2.vo.ProductVO;
import jangdolbaeng2.vo.Product_orderVO;
import jangdolbaeng2.vo.Qa_commentVO;
import jangdolbaeng2.vo.SellerVO;
import jangdolbaeng2.vo.ShopVO;
import jangdolbaeng2.vo.Shop_blogVO;
import jangdolbaeng2.vo.Shop_qaVO;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

public class TransferDAO {
	private SqlSessionFactory factory = MybatisConfig.getSqlSessionFactory();
	private SqlSessionFactory targetFactory = DBTransferConfig
			.getSqlSessionFactory();
	SqlSession ss = null;
	SqlSession tss = null;

	// seller
	public List<SellerVO> selectSeller() {	
		List<SellerVO> list = null;
		ss = factory.openSession();
		try {
			list=ss.selectList("transfer.sellerGet");
			ss.commit();

		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
	}

	public void insertSeller(List<SellerVO> data) {
		tss = targetFactory.openSession();
		try {
			tss.insert("transfer.sellerPut", data);
			tss.commit();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	// shop
	public List<ShopVO> selectShop() {
		List<ShopVO> list = null;
		ss = factory.openSession();
		try {
			list=ss.selectList("transfer.shopGet");
			ss.commit();

		} catch (Exception e) {
			e.printStackTrace();
		}

		return list;
	}

	public void insertShop(List<ShopVO> data) {
		tss = targetFactory.openSession();
		try {

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	// shop_blog
	public List<Shop_blogVO> selectShopBlog() {
		List<Shop_blogVO> list = null;
		ss = factory.openSession();

		try {

		} catch (Exception e) {
			e.printStackTrace();
		}

		return list;
	}

	public void insertShopBlog(List<Shop_blogVO> data) {
		tss = targetFactory.openSession();
		try {

		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	// customer

	public List<CustomerVO> selectCustomer() {
		List<CustomerVO> list = null;
		ss = factory.openSession();

		try {

		} catch (Exception e) {
			e.printStackTrace();
		}

		return list;

	}

	public void insertCustomer(List<CustomerVO> data) {
		tss = targetFactory.openSession();
		try {

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	// product
	public List<ProductVO> selectProduct() {
		List<ProductVO> list = null;
		ss = factory.openSession();

		try {

		} catch (Exception e) {
			e.printStackTrace();
		}

		return list;

	}

	public void insertProduct(List<ProductVO> data) {
		tss = targetFactory.openSession();
		try {

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	// cart
	public List<CartVO> selectCart() {
		List<CartVO> list = null;
		ss = factory.openSession();

		try {

		} catch (Exception e) {
			e.printStackTrace();
		}

		return list;

	}

	public void insertCart(List<CartVO> data) {
		tss = targetFactory.openSession();
		try {

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	// order
	public List<Product_orderVO> selectOrder() {
		List<Product_orderVO> list = null;
		ss = factory.openSession();

		try {

		} catch (Exception e) {
			e.printStackTrace();
		}

		return list;

	}

	public void insertOrder(List<Product_orderVO> data) {
		tss = targetFactory.openSession();
		try {

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	// order_detail
	public List<Order_detailVO> selectOrderDetail() {
		List<Order_detailVO> list = null;
		ss = factory.openSession();

		try {

		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
	}

	public void insertOrderDetail(List<Order_detailVO> data) {
		tss = targetFactory.openSession();
		try {

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	// delivery

	public List<DeliveryVO> selectDelivery() {
		List<DeliveryVO> list = null;
		ss = factory.openSession();

		try {

		} catch (Exception e) {
			e.printStackTrace();
		}

		return list;
	}

	public void insertDelivery(List<DeliveryVO> data) {
		tss = targetFactory.openSession();
		try {

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	// shop_qa
	public List<Shop_qaVO> selectShopQA() {
		List<Shop_qaVO> list = null;
		ss = factory.openSession();

		try {

		} catch (Exception e) {
			e.printStackTrace();
		}

		return list;
	}

	public void insertShopQA(List<Shop_qaVO> data) {
		tss = targetFactory.openSession();
		try {

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	// qa_comment
	public List<Qa_commentVO> selectQaComment() {
		List<Qa_commentVO> list = null;
		ss = factory.openSession();

		try {

		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
	}

	public void insertQaComment(List<Qa_commentVO> data) {
		tss = targetFactory.openSession();
		try {

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}